<template>
  <div>
    <el-drawer
      title="用户提交信息"
      :visible.sync="visible"
      size="100%"
      :before-close="handleClose"
    >
      <div v-if="curItem.examineOrder >= 2" style="padding: 30px;">
        <personInfoCard :id="id" :visible="childrenVisible" />
        <div style="padding-top: 20px;" />
        <incomingCard :id="id" :visible="childrenVisible" />
        <div style="padding-top: 20px;" />
        <carImageCard :id="id" :visible="childrenVisible" />
        <div style="padding-top: 20px;" />

        <div v-if="curItem.examineOrder >= 4">
          <bankImageCard :id="id" :visible="childrenVisible" />
          <div style="padding-top: 20px;" />
        </div>
        <div v-if="curItem.examineOrder >= 5">
          <contractCard :id="id" :visible="childrenVisible" />
          <div style="padding-top: 20px;" />
        </div>
        <div v-if="curItem.examineOrder >= 6">
          <workOrderCard :id="id" :visible="childrenVisible" />
          <div style="padding-top: 20px;" />
        </div>
        <div v-if="curItem.examineOrder >= 7">
          <orderConstructCard :id="id" :visible="childrenVisible" />
        </div>
        <div v-if="curItem.examineOrder >= 8">
          <moenyCard :id="id" :visible="childrenVisible" />
        </div>

      </div>
      <!-- moenyCard -->
    </el-drawer>
  </div>
</template>

<script>
import incomingCard from './Cards/incomingCard.vue'
import personInfoCard from './Cards/personInfoCard.vue'
import carImageCard from './Cards/carImageCard.vue'
import bankImageCard from './Cards/bankImageCard.vue'
import contractCard from './Cards/contractCard.vue'
import workOrderCard from './Cards/workOrderCard.vue'
import orderConstructCard from './Cards/orderConstructCard.vue'
import moenyCard from './Cards/moenyCard.vue'
export default {
  components: {
    personInfoCard,
    incomingCard,
    carImageCard,
    bankImageCard,
    contractCard,
    workOrderCard,
    orderConstructCard,
    moenyCard
  },
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    id: {
      type: Number,
      default: 0
    },
    defaultValue: {
      type: Object,
      default: () => ({})
    },
    curItem: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
      childrenVisible: false
    }
  },
  watch: {
    visible: {
      handler(val) {
        if (val) {
          setTimeout(() => {
            this.childrenVisible = true
          }, 100)
        } else {
          this.childrenVisible = false
        }
      }
    }
  },
  methods: {
    handleClose() {
      this.$emit('handleClose', false)
    }
  }
}
</script>
